import java.net.URL;
import java.util.List;

import org.w3c.dom.html.HTMLElement;

import net.htmlparser.jericho.*;


public class JerichoTest {
	public static void main(String[] args) {
		String url="http://isbn0704.cafe24.com/book.html";
		try {
			URL u = new URL(url);
			Source s = new Source(u);	//Jericho API
			int sum = 0;
			List<Element> list = s.getAllElements(HTMLElementName.TR);
			for (int i = 0; i < list.size(); i++) {
				s = new Source(list.get(i).getContent());
				List<Element> td = s.getAllElements(HTMLElementName.TD);
				for (int j = 0; j < td.size(); j++) {
					String t = td.get(j).getContent().toString();
					if(j==3){
						sum+=Integer.parseInt(t);
					}
					System.out.print(t+"\t");
				}
				System.out.println();
			}
			System.out.println(sum);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
	}
}